package com.gxa.eshops.portal.entity.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @program: IntelliJ IDEA
 * @description:
 * @author: Mr.Wang
 * @create: 2022-07-08 20:53
 **/
@Data
@Entity
@Table(name = "tb_goods")
public class Goods implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "goods_id")
    private Long goodsId;
    @Column(name = "goods_title")
    private String goodsTitle;
    @Column(name = "sell_point")
    private String sellPoint;
    @Column(name = "goods_price")
    private Double goodsPrice;
    @Column(name = "goods_num")
    private Integer goodsNum;
    @Column(name = "goods_barcode")
    private String goodsBarcode;
    @Column(name = "goods_image")
    private String goodsImage;
    @Column(name = "cate_id")
    private Long cateId;
    @Column(name = "status")
    private Integer status;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @Column(name = "goods_created")
    private LocalDateTime goodsCreated;

    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @Column(name = "goods_updated")
    private LocalDateTime goodsUpdated;

}
